<template>
	<view>
		<!-- <view class="InfoTitle">
			<view class="InfoNav">
				<view :style="{background:bb?'#1CBBB4':'#007AFF'}" @tap="changeBB(true)">档案
				</view>
				<view :style="{background:!bb?'#1CBBB4':'#007AFF'}" @tap="changeBB(false)">报表</view>
			</view>
		</view> -->
		<zy-grid :col="3" :showTip="false" :showTitle="false" :dataList="dataList" v-if="!bb"></zy-grid>
		<zy-grid :col="3" :showTip="false" :showTitle="false" :dataList="dadataList" v-if="bb"></zy-grid>
		<tab-bar :current="bb?3:1"></tab-bar>
	</view>
</template>
<script>
	import tabBar from "../../components/tabBar.vue"
	import zyGrid from '../../components/zy-grid/zy-grid.vue'
	export default {
		components: {
			zyGrid,
			tabBar
		},
		methods: {
			changeBB(state) {
				this.bb = state;
			}
		},
		onLoad(options) {
			let state = options.type;
			if (state == 1) {
				this.bb = false;
			} else {
				this.bb = true;
			}
			if (this.bb) {
				uni.setNavigationBarTitle({
					title: "档案中心"
				})
			} else {
				uni.setNavigationBarTitle({
					title: "报表查询"
				})
			}
			let PDA_Module_Options = uni.getStorageSync("PDA_Module_Options");
			PDA_Module_Options = JSON.parse(PDA_Module_Options);
			var that = this;
			PDA_Module_Options.forEach((item,index)=>{
				if(item.ModuleName=="商品类型"){
					if(item.IsBill==''){
						this.dadataList[0].isShow = false;					 
					}
				}
				if(item.ModuleName=="商品单位"){
					if(item.IsBill==''){
						this.dadataList[1].isShow = false;					 
					}
				}
				if(item.ModuleName=="商品档案"){
					if(item.IsBill==''){
						this.dadataList[2].isShow = false;					 
					}
				}
				if(item.ModuleName=="机构档案"){
					if(item.IsBill==''){
						this.dadataList[3].isShow = false;					 
					}
				}
				if(item.ModuleName=="仓库档案"){
					if(item.IsBill==''){
						this.dadataList[4].isShow = false;					 
					}
				}
				if(item.ModuleName=="部门档案"){
					if(item.IsBill==''){
						this.dadataList[5].isShow = false;					 
					}
				}
				
				if(item.ModuleName=="员工档案"){
					if(item.IsBill==''){
						this.dadataList[6].isShow = false;					 
					}
				}
				if(item.ModuleName=="往来单位"){
					 if(item.IsBill==''){
					 	this.dadataList[7].isShow = false;					 
					 }
				}
				if(item.ModuleName=="会员档案"){
					if(item.IsBill==''){
						this.dadataList[8].isShow = false;					 
					}
				}
				if(item.ModuleName=="银行账号"){
					if(item.IsBill==''){
						this.dadataList[9].isShow = false;					 
					}
				}
				
				if(item.ModuleName=="业务草稿"){
					if(item.IsBill==''){
						this.dataList[0].isShow = false;					 
					}
				}
				if(item.ModuleName=="采购查询(商品汇总)"){
					if(item.IsBill==''){
						this.dataList[1].isShow = false;					 
					}
				}
				if(item.ModuleName=="销售查询(商品汇总)"){
					if(item.IsBill==''){
						this.dataList[2].isShow = false;					 
					}
				}
				if(item.ModuleName=="供应商采购汇总"){
					if(item.IsBill==''){
						this.dataList[3].isShow = false;					 
					}
				}
				if(item.ModuleName=="客户销售汇总"){
					if(item.IsBill==''){
						this.dataList[4].isShow = false;					 
					}
				}
				if(item.ModuleName=="经营历程"){
					if(item.IsBill==''){
						this.dataList[5].isShow = false;					 
					}
				}
				if(item.ModuleName=="库存状况"){
					if(item.IsBill==''){
						this.dataList[6].isShow = false;					 
					}
				}
				if(item.ModuleName=="收银流水(POS)"){
					if(item.IsBill==''){
						this.dataList[7].isShow = false;					 
					}
				}
				if(item.ModuleName=="商品销售流水(POS)"){
					if(item.IsBill==''){
						this.dataList[8].isShow = false;					 
					}
				}
				if(item.ModuleName=="应收应付"){
					if(item.IsBill==''){
						this.dataList[9].isShow = false;					 
					}
				}
				if(item.ModuleName=="销售毛利汇总"){
					if(item.IsBill==''){
						this.dataList[10].isShow = false;					 
					}
				}
				if(item.ModuleName=="业务员采购统计"){
					if(item.IsBill==''){
						this.dataList[11].isShow = false;					 
					}
				}
				if(item.ModuleName=="业务员销售统计"){
					if(item.IsBill==''){
						this.dataList[12].isShow = false;					 
					}
				}
			});
		},
		data() {
			return {
				bb: true,
				dataList: [{
						name: "业务草稿",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../BillProcess/BillProcess?type=0',
						isShow: true
					}, {
						name: "采购查询(商品汇总)",
						imgUrl: '../../static/orderlist/cg.svg',
						url: '../order/order?type=0',
						isShow: true
					}, {
						name: "销售查询(商品汇总)",
						imgUrl: '../../static/orderlist/sale.svg',
						url: '../order/order?type=1',
						isShow: true
					}, {
						name: "供应商采购汇总",
						imgUrl: '../../static/orderlist/cg.svg',
						url: '../curstomOrder/curstomOrder?type=0',
						isShow: true
					}, {
						name: "客户销售汇总",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../curstomOrder/curstomOrder?type=1',
						isShow: true
					}, {
						name: "经营历程",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../BillProcess/BillProcess?type=1',
						isShow: true
					}, {
						name: "库存状况",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../StatusProcess/StatusProcess',
						isShow: true
					}, {
						name: "收银流水(POS)",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../giveMoneyWater/giveMoneyWater',
						isShow: true
					},
					{
						name: "商品销售流水(POS)",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../saleWater/saleWater',
						isShow: true
					}, {
						name: "应收应付",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../ysyf/ysyf',
						isShow: true
					}, {
						name: "销售毛利汇总",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../SaleProfit/saleProfit',
						isShow: true
					}, {

						name: "业务员采购统计",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../accountOrder/accountOrder?type=0',
						isShow: true
					}, {
						name: "业务员销售统计",
						imgUrl: '../../static/orderlist/yw.svg',
						url: '../accountOrder/accountOrder?type=1',
						isShow: true
					},
				],
				dadataList: [{
					name: "商品类型",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../InfoListpage/goodfl',
					isShow: true
				}, {
					name: "商品单位",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../info-goodUnit/info-goodUnit',
					isShow: true
				}, {
					name: "商品档案",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../info-GoodsMessage/info-GoodsMessage',
					isShow: true
				}, {
					name: "机构档案",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../info-organ/info-organ02',
					isShow: true
				}, {
					name: "仓库档案",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../info-storehouse/info-storehouse',
					isShow: true
				}, {
					name: "部门档案",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../info-department/info-department',
					isShow: true
				}, {
					name: "员工档案",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../info-staff/info-staff',
					isShow: true
				}, {
					name: "往来单位",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../info-comeUnit/info-comeUnit',
					isShow: true
				}, {
					name: "会员档案",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../info-vipMessage/info-vipMessage',
					isShow: true

				}, {
					name: "银行账号",
					imgUrl: '../../static/orderlist/yw.svg',
					url: '../info-BankMessage/info-BankMessage',
					isShow: true
				}]
			}
		}
	}
</script>

<style lang="scss">
	page {
		padding-bottom: 0px;
	}

	.InfoTitle {
		width: 100%;
		height: 80upx;
		line-height: 80upx;
		background: $bb-bg-color;
		color: #FFF;
		padding-top: 10upx;

		.InfoNav {
			width: 80%;
			display: flex;
			flex-direction: row;
			margin: auto;
			height: 60upx;
			line-height: 60upx;
			border-radius: 10upx;
			background: #007AFF;
			border-radius: 10upx;

			view {
				flex: 1;
				text-align: center;
				height: 60upx;
				line-height: 60upx;
			}
		}
	}
</style>
